<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreatePartyEmsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('party_ems', function (Blueprint $table) {
            $table->increments('id')->comment('党务信箱表');
            $table->string('ems_title', 255)->nullable()->comment('信件标题');
            $table->tinyInteger('ems_type')->nullable()->comment('信件类别;意见建议1、申诉2、控告3、其他4')->default(0);
            $table->tinyInteger('ems_open')->nullable()->comment('信件是否公开;公开1，否0')->default(0);
            $table->string('ems_writer', 64)->nullable()->comment('写信人名字');
            $table->tinyInteger('ems_sex')->nullable()->comment('写信人性别;男1，女0')->default(0);
            $table->string('ems_address', 255)->nullable()->comment('写信人地址');
            $table->string('ems_mobile', 32)->nullable()->comment('写信人手机号');
            $table->tinyInteger('status')->nullable()->comment('信件处理状态;未处理0、处理中1，已处理2')->default(0);
            $table->integer('region_id')->nullable()->comment('所属地区ID（1.北洸村）')->default(0);
            $table->text('ems_content')->nullable()->comment('信件内容');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('party_ems');
    }
}
